<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
        }

        .box {
            width: 200px;
            height: 200px;
            background-color: red;

        }
    </style>
</head>

<body>
    <div class="box"></div>
</body>
<script>
    window.onresize = function() {
        var width = document.body.clientWidth
        console.log(width);
        var fontSize = width / 37.5 + 'px'
        console.log(fontSize);

        document.documentElement.style.fontSize = fontSize
        console.log(document.documentElement.style.fontSize);

    }
    window.onload = function() {
        var width = document.body.clientWidth
        var fontSize = width / 37.5 + 'px'
        document.documentElement.style.fontSize = fontSize
    }
</script>

</html>